/*
 * $Id: CharacterOutputStream.java 37 2012-12-28 09:15:03Z vladimirow@mail.ru $
 * $HeadURL: http://ultralog.googlecode.com/svn/ultralog/tags/release-0.1/src/java/com/google/code/ultralog/utils/CharacterOutputStream.java $
 *
 * This file is a part of ultralog project (http://code.google.com/p/ultralog/).
 * Released under New BSD License.
 */
package com.google.code.ultralog.utils;


/**
 * Output steam of characters.
 *
 * @author Mikhail Vladimirov
 */
public interface CharacterOutputStream
{
    /**
     * Write single character to the stream.
     *
     * @param ch character to be written
     */
    public void write (char ch);

    /**
     * Write two characters to the stream.
     *
     * @param ch1 first character to be written
     * @param ch2 second character to be written
     */
    public void write (char ch1, char ch2);

    /**
     * Write three characters to the stream.
     *
     * @param ch1 first character to be written
     * @param ch2 second character to be written
     * @param ch3 third character to be written
     */
    public void write (char ch1, char ch2, char ch3);

    /**
     * Write four characters to the stream.
     *
     * @param ch1 first character to be written
     * @param ch2 second character to be written
     * @param ch3 third character to be written
     * @param ch4 fourth character to be written
     */
    public void write (char ch1, char ch2, char ch3, char ch4);

    /**
     * Write range of characters from given buffer.
     *
     * @param buffer character array to write characters from
     * @param offset offset of the range inside the buffer
     * @param length length of the range
     */
    public void write (char [] buffer, int offset, int length);

    /**
     * Write range of characters from given string.
     *
     * @param string string to write characters from
     * @param offset offset of the range inside the string
     * @param length length of the range
     */
    public void write (String string, int offset, int length);

    /**
     * Write range of characters from given {@link CharSequence} object.
     *
     * @param sequence {@link CharSequence} object to write characters from
     * @param offset offset of the range inside the sequence
     * @param length length of the range
     */
    public void write (CharSequence sequence, int offset, int length);

    /**
     * Write range of characters from given {@link CharacterSequence} object.
     *
     * @param sequence {@link CharacterSequence} object to write characters from
     * @param offset offset of the range inside the sequence
     * @param length length of the range
     */
    public void write (CharacterSequence sequence, int offset, int length);

    /**
     * Flush stream.
     */
    public void flush ();
}
